package presentationTier.actions;

import businessTier.IMovieFacade;
import businessTier.MovieFacade;
import core.Genre;
import core.MovieException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import presentationTier.dialogs.ChangeGenreDialog;

/**
 *
 * @author vojta
 */
public class ChangeGenreRemoveAction implements ActionListener{

    ChangeGenreDialog dialog;

    public ChangeGenreRemoveAction(ChangeGenreDialog aThis) {
        dialog = aThis;
    }

    public void actionPerformed(ActionEvent e) {
         Genre genre = (Genre) dialog.jComboBox1.getSelectedItem();

        try {
            IMovieFacade mf = MovieFacade.getInstance();
            mf.removeGenre(genre);

            dialog.readGenres();

        } catch (MovieException ex) {
            ex.printStackTrace();
        }
    }

}
